#pragma once
#include"global.h"

using namespace std;



enum class ErrorType {
    MULTIPLE_DECIMAL_POINTS,
    DECIMAL_POINT_AT_EDGE,
    LEADING_ZEROS,
    UNRECOGNIZED_CHAR,
    NONE
};

struct Token {
    string value;
    string type;
};

struct LexerResult {
    vector<Token> tokens;
    ErrorType error;
    string errorMsg;
    void print() {
		for (const auto& token : tokens) {
			cout << token.value << " " << token.type << endl;
		}
		if (error != ErrorType::NONE) {
			cout << errorMsg << endl;
		}
    }
};

class Lexer
{
public:
	Lexer() = default;
    Lexer(string& input)
    {
        this->input = input;
        result.error = ErrorType::NONE;
    }
    void lex();
	LexerResult getResult() const { return result; }
private:
    string input;
    LexerResult result;
};

